﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Objects;

namespace medder.Registrator
{
    public partial class CreateTable : Form
    {

        MedBaseEntities med = new MedBaseEntities();
        public static ObjectSet<Profile> profiles;
        public static ObjectSet<Doctor> doctors;
        public static ObjectSet<TimeTable> timetables;
        public static ObjectSet<User> users;
        public CreateTable()
        {
            InitializeComponent();
            profiles = med.Profiles;
            doctors = med.Doctors;
            timetables = med.TimeTables;
            users = med.Users;
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void CreateTable_Load(object sender, EventArgs e)
        {
 
            foreach (var doc in doctors)
            {
                User docUser = users.Where(x => x.Passport.Equals(doc.Passport)).FirstOrDefault();
                comboBox1.Items.Add(string.Format("{0} {1} {2}", docUser.Surname, docUser.Name, docUser.Patronymic));
            }
        }
    }
}
